package com.handinglian.common.enums;

public enum LoginTypeEnum {
    PC(1,"PC端"),
    ANDROID(2,"安卓端"),
    IOS(3,"IOS端");

    public static LoginTypeEnum valueOfOrdinal(Integer ordinal) {
        return ordinal == null || ordinal >= values().length ? null : values()[ordinal];
    }
    public static LoginTypeEnum valueOfDesc(String desc) {
        for(LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()){
            if(desc.equals(loginTypeEnum.getDescription())){
                return loginTypeEnum;
            }
        }
        return null;
    }
    public static LoginTypeEnum valueOfKey(Integer key){
        for(LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()){
            if(loginTypeEnum.getKey()==key){
                return loginTypeEnum;
            }
        }
        return null;
    }
    private final Integer key;
    private final String description;

    LoginTypeEnum(Integer key, String description) {
        this.key = key;
        this.description = description;
    }

    public Integer getKey() {
        return key;
    }
    public String getDescription() {
        return this.description;
    }
}
